
package doublelinks;

import java.util.Iterator;
import java.util.Random;

import jss2.LinearNode;
import jss2.LinkedIterator;

public class SingleLinkTester {

	static final String	YOURNAME	= "Chris Symons";

	public static void main (final String [] args) {

		System.out.printf ("Lab 4 written by %s%n", SingleLinkTester.YOURNAME);

		final LinearNode <String> ln1 = new LinearNode <String> ("apple");
		final LinearNode <String> ln2 = new LinearNode <String> ("orange");
		final LinearNode <String> ln3 = new LinearNode <String> ("grape");

		System.out.println (ln1);
		System.out.println (ln2);
		System.out.println (ln3);
		System.out.println ();

		ln1.setNext (ln2);
		ln2.setNext (ln3);
		final Iterator <String> iter = new LinkedIterator <String> (ln1);
		while (iter.hasNext ()) {
			final String temp = iter.next ();
			System.out.println (temp);
		}
		
	}
}
